// import something here

// "async" is optional;
// more info on params: https://quasar.dev/quasar-cli/boot-files



export default async ( { app, router, Vue  } ) => {
  const user ={
    isAdmin(){
      const userinfo = JSON.parse((window.localStorage.getItem('userinfo')));
      if(userinfo && userinfo.webadmin>=1){
        return true
      }else{
        return false
      }
      
  
    },
    isSuperAdmin(){
      const userinfo = JSON.parse((window.localStorage.getItem('userinfo')));
      if(userinfo && userinfo.webadmin>=2){
        return true
      }else{
        return false
      }
  
    },
    isCoreAdmin(){
      const userinfo = JSON.parse((window.localStorage.getItem('userinfo')));
      if(userinfo && userinfo.webadmin>=3){
        return true
      }else{
        return false
      }
  
    },
    isWechatUser(){
      const userinfo = JSON.parse((window.localStorage.getItem('userinfo')));
      if(userinfo && userinfo.openid.length >0){
        return true
      }else{
        return false
      }
  
    },
    isQwUser(){
      const userinfo = JSON.parse((window.localStorage.getItem('userinfo')));
      if(userinfo && userinfo.eid.length>0){
        return true
      }else{
        return false
      }
  
  
    }
  
  }
  Vue.prototype.$User = user
}
